package com.kuang.annotation;

public class Test06 {
    public static void main(String[] args) throws ClassNotFoundException {
        //                获取系统类的加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);
        //获取系统类的加载器的父类加载器-->扩展类加载器
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);
        //获取扩展类加载器的父类加载器-->根加载器(c/c++)
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);
        //看当前类的类加载器是那个加载器加载的
        //
        ClassLoader classLoader = Class.forName("com.kuang.annotation.Test06").getClassLoader();
        System.out.println(classLoader);
        //测试JDK内部类是由根加载器加载的
        classLoader = Class.forName("java.lang.Object").getClassLoader();
        System.out.println(classLoader);
        //如何获取系统类加载器可以获取的路径
        System.out.println(System.getProperty("java.class.path"));


        //双亲委派机制
                //用户自定义的

        /**
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\charsets.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\access-bridge-64.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\cldrdata.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\dnsns.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\jaccess.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\jfxrt.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\localedata.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\nashorn.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\sunec.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\sunjce_provider.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\sunmscapi.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\sunpkcs11.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\ext\zipfs.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\jce.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\jfr.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\jfxswt.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\jsse.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\management-agent.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\resources.jar;
         * C:\Users\Knife\.jdks\corretto-1.8.0_362\jre\lib\rt.jar;
         * F:\IDE\注解与反射\out\production\注解与反射;
         * F:\IDE\IntelliJ IDEA 2021.1.3\lib\idea_rt.jar
         */
    }
}
